package com.heima.fegins;

import com.heima.config.HeimaFeignAutoConfiguration;
import com.heima.fegins.fallback.ArticleFeignFallback;
import com.heima.model.common.article.pojos.ApAuthor;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "leadnews-article",
        fallbackFactory = ArticleFeignFallback.class,
        configuration = HeimaFeignAutoConfiguration.class )

public interface AuthorFegin {
    @GetMapping("/api/v1/author/findByUserId/{id}")
    ResponseResult<ApAuthor> findByUserId(@PathVariable Integer id);
    @PostMapping("/api/v1/author/save")
    ResponseResult<ApAuthor> save(@RequestBody ApAuthor apAuthor);
}
